CREATE
DATABASE `seckill`  DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ;

USE
`seckill`;

-- ----------------------------
-- Table structure for se_act_money
-- ----------------------------
DROP TABLE IF EXISTS `se_act_money`;
CREATE TABLE `se_act_money`
(
    `id`     int NOT NULL AUTO_INCREMENT,
    `act_id` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '活动id',
    `money`  decimal(18, 2)                  DEFAULT NULL COMMENT '金额',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of se_act_money
-- ----------------------------
BEGIN;
INSERT INTO `se_act_money`
VALUES (1, 'BU700399334222737408', 1000.99);
INSERT INTO `se_act_money`
VALUES (2, 'GQ680482692634259456', 1000.99);
INSERT INTO `se_act_money`
VALUES (3, 'TH700409731671666688', 1000.99);
INSERT INTO `se_act_money`
VALUES (4, 'TM680759928541163520', 1000.99);
COMMIT;

-- ----------------------------
-- Table structure for se_activity
-- ----------------------------
DROP TABLE IF EXISTS `se_activity`;
CREATE TABLE `se_activity`
(
    `id`               varchar(20) NOT NULL COMMENT '秒杀活动表ID',
    `com_id`           varchar(20)  DEFAULT NULL COMMENT '商品id',
    `com_name`         varchar(20)  DEFAULT NULL COMMENT '商品名称',
    `act_num`          int          DEFAULT NULL COMMENT '秒杀数量',
    `act_start`        datetime     DEFAULT NULL COMMENT '活动时间',
    `act_end`          datetime     DEFAULT NULL COMMENT '活动结束时间',
    `act_title`        varchar(20)  DEFAULT NULL COMMENT '活动名称',
    `act_info`         varchar(100) DEFAULT NULL COMMENT '活动详情',
    `act_know`         varchar(100) DEFAULT NULL COMMENT '活动须知',
    `act_condition_id` varchar(20)  DEFAULT NULL COMMENT '活动条件，绑定另外一张活动条件表',
    `state`            tinyint      DEFAULT '1' COMMENT '活动状态（1：启用,0：关闭）',
    `create_by`        varchar(20)  DEFAULT NULL COMMENT '创建者编号',
    `create_by_name`   varchar(20)  DEFAULT NULL COMMENT '创建者名称',
    `is_deleted`       tinyint(1) DEFAULT '0' COMMENT '是否删除(1删除/0未删除)',
    `limit_year`       int          DEFAULT NULL COMMENT '允许参加活动的年龄',
    `work_state`       int          DEFAULT NULL COMMENT '允许参加的工作状态(1:无业/2:失业/3:就业/4：不做限制)',
    `promise_state`    int          DEFAULT NULL COMMENT '允许参加的失信状态(1:未纳入失信名单/2:纳入失信名单/3：不做限制)',
    `loan_time`        int          DEFAULT NULL COMMENT '允许参加活动的最大逾期次数',
    `is_fitter`        tinyint(1) DEFAULT NULL COMMENT '是否开启筛选（1开启/0未开启）',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of se_activity
-- ----------------------------
BEGIN;
INSERT INTO `se_activity`
VALUES ('BU700399334222737408', 'QK680468718232547328', '商品2', 100, '2021-10-11 19:12:12', '2021-10-12 19:13:13',
        '秒杀活动', '详情', '须知', 'KG700399333954301952', 1, 'VL700397174957289472', 'ADMIN', 0, 18, 1, 1, 3, NULL);
INSERT INTO `se_activity`
VALUES ('GQ680482692634259456', 'QK680468718232547328', NULL, 100, '2021-10-12 08:00:00', '2021-10-13 08:00:00', '秒杀活动',
        '详情', '须知', 'CW680482692491653120', 1, 'HP680437607842459648', 'ADMIN', 0, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `se_activity`
VALUES ('TH700409731671666688', 'QK680468718232547328', '商品2', 100, '2021-10-11 19:12:12', '2021-10-12 19:13:13',
        '秒杀活动', '详情', '须知', 'VK700409731306762240', 1, 'VL700397174957289472', 'ADMIN', 0, 18, 1, 1, 3, NULL);
INSERT INTO `se_activity`
VALUES ('TM680759928541163520', 'QK680468718232547328', '商品2', 100, '2021-10-12 08:12:12', '2021-10-13 08:13:13',
        '秒杀活动', '详情', '须知', 'RI680759928402751488', 1, 'HP680437607842459648', 'ADMIN', 0, NULL, NULL, NULL, NULL,
        NULL);
INSERT INTO `se_activity`
VALUES ('VP680487075245731840', 'QK680468718232547328', '商品2', 100, '2021-10-12 08:00:00', '2021-10-13 08:00:00',
        '秒杀活动', '详情', '须知', 'CT680487075036016640', 1, 'HP680437607842459648', 'ADMIN', 0, NULL, NULL, NULL, NULL,
        NULL);
COMMIT;

-- ----------------------------
-- Table structure for se_activity_log
-- ----------------------------
DROP TABLE IF EXISTS `se_activity_log`;
CREATE TABLE `se_activity_log`
(
    `id`         varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
    `user_id`    varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `act_id`     varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动id',
    `watch_time` datetime                                                     DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of se_activity_log
-- ----------------------------
BEGIN;
INSERT INTO `se_activity_log`
VALUES ('1', 'VL700397174957289472', 'BU700399334222737408', '2022-03-30 21:05:02');
INSERT INTO `se_activity_log`
VALUES ('2', 'VL700397174957289472', 'BU700399334222737408', '2022-03-31 21:05:02');
INSERT INTO `se_activity_log`
VALUES ('DN706681548518469632', 'VL700397174957289472', 'TM680759928541163520', '2022-03-30 10:01:16');
INSERT INTO `se_activity_log`
VALUES ('TW706858183116992512', 'VL700397174957289472', 'TM680759928541163520', '2022-03-30 21:43:09');
INSERT INTO `se_activity_log`
VALUES ('XM706857670484963328', 'VL700397174957289472', 'TM680759928541163520', '2022-03-30 21:41:07');
COMMIT;

-- ----------------------------
-- Table structure for se_commodity
-- ----------------------------
DROP TABLE IF EXISTS `se_commodity`;
CREATE TABLE `se_commodity`
(
    `id`           varchar(20) NOT NULL COMMENT '商品表ID',
    `com_name`     varchar(20) DEFAULT NULL COMMENT '商品名称',
    `com_describe` varchar(20) DEFAULT NULL COMMENT '商品描述',
    `com_stock`    int         DEFAULT NULL COMMENT '商品现库存',
    `com_sales`    int         DEFAULT NULL COMMENT '商品销量',
    `com_money`    double      DEFAULT NULL COMMENT '商品价格',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of se_commodity
-- ----------------------------
BEGIN;
INSERT INTO `se_commodity`
VALUES ('FU676556603989962752', NULL, NULL, NULL, 0, NULL);
INSERT INTO `se_commodity`
VALUES ('QK680468718232547328', '商品2', '这是商品2', 100, 0, NULL);
COMMIT;


-- ----------------------------
-- Table structure for se_order
-- ----------------------------
DROP TABLE IF EXISTS `se_order`;
CREATE TABLE `se_order`
(
    `id`        varchar(20) NOT NULL COMMENT '订单表ID',
    `ord_no`    varchar(35) DEFAULT NULL COMMENT '订单编号',
    `user_id`   varchar(20) DEFAULT NULL COMMENT '所属用户id',
    `com_id`    varchar(20) DEFAULT NULL COMMENT '购买的商品id',
    `pay_num`   int         DEFAULT NULL COMMENT '购买的数量',
    `act_start` date        DEFAULT NULL COMMENT '下单时间',
    `state`     int         DEFAULT NULL COMMENT '订单状态 （0已支付 / 1 未支付 ',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of se_order
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for se_user
-- ----------------------------
DROP TABLE IF EXISTS `se_user`;
CREATE TABLE `se_user`
(
    `id`            varchar(20) NOT NULL COMMENT '用户表id',
    `user_name`     varchar(20)    DEFAULT NULL COMMENT '用户名',
    `pass_word`     varchar(20)    DEFAULT NULL COMMENT '密码',
    `phone`         varchar(11)    DEFAULT NULL COMMENT '手机号',
    `real_name`     varchar(20)    DEFAULT NULL COMMENT '真实姓名',
    `login_ip`      varchar(20)    DEFAULT NULL COMMENT '用户第一次登录URL',
    `id_card`       varchar(20)    DEFAULT NULL COMMENT '证件号（身份证）',
    `year`          int            DEFAULT NULL COMMENT '年龄',
    `work_state`    int            DEFAULT NULL COMMENT '工作状态(1:无业/2:失业/3:就业)',
    `promise_state` int            DEFAULT NULL COMMENT '失信状态(1:未纳入失信名单/2:纳入失信名单)',
    `loan_time`     int            DEFAULT NULL COMMENT '逾期次数',
    `money`         decimal(18, 2) DEFAULT NULL COMMENT '余额',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of se_user
-- ----------------------------
BEGIN;
INSERT INTO `se_user`
VALUES ('1', 'test', '123456', '12345678910', 't', NULL, NULL, 19, 0, 0, 0, 99.99);
INSERT INTO `se_user`
VALUES ('KR706957695521140736', '涂英俊5', 'root', '15377360137', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `se_user`
VALUES ('LY706957594794930176', '涂英俊3', 'root', '15377360135', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `se_user`
VALUES ('OQ706957532962500608', '涂英俊2', 'root', '15377360134', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `se_user`
VALUES ('PF706185936941363200', '涂英俊', 'root', '15377360132', NULL, '0:0:0:0:0:0:0:1', NULL, 19, NULL, NULL, NULL,
        99.99);
INSERT INTO `se_user`
VALUES ('PH700409617569820672', 'ADMIN', 'admin', '15377360131', NULL, NULL, NULL, 19, NULL, NULL, NULL, 99.99);
INSERT INTO `se_user`
VALUES ('RM706134476388052992', '涂俊杰', 'root', '17872373058', NULL, '0:0:0:0:0:0:0:1', NULL, 19, NULL, NULL, NULL,
        99.99);
INSERT INTO `se_user`
VALUES ('TG706957640496066560', '涂英俊4', 'root', '15377360136', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `se_user`
VALUES ('VL700397174957289472', 'ADMIN', 'admin', '15377360130', NULL, '192.168.224.1', NULL, 19, NULL, NULL, NULL,
        99.99);
INSERT INTO `se_user`
VALUES ('WS706957431384846336', '涂英俊1', 'root', '15377360133', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `se_user`
VALUES ('XV706958018822287360', '涂英俊6', 'root', '15377360138', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for se_user_commodity
-- ----------------------------
DROP TABLE IF EXISTS `se_user_commodity`;
CREATE TABLE `se_user_commodity`
(
    `id`         varchar(20) NOT NULL COMMENT '用户秒杀活动绑定表ID',
    `user_id`    varchar(20) DEFAULT NULL COMMENT '用户编号',
    `act_id`     varchar(20) DEFAULT NULL COMMENT '活动编号',
    `is_deleted` tinyint     DEFAULT '0' COMMENT '是否删除(1删除/0未删除)',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of se_user_commodity
-- ----------------------------
BEGIN;
INSERT INTO `se_user_commodity`
VALUES ('BN680494028026032128', 'HP680437607842459648', 'VP680487075245731840', 1);
INSERT INTO `se_user_commodity`
VALUES ('PZ680496078403153920', 'HP680437607842459648', 'VP680487075245731840', 0);
COMMIT;

SET
FOREIGN_KEY_CHECKS = 1;
